home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / util4 / bngr1357.lha / BangerVersion.Asm < prev    next >
Assembly Source File  |  1995-09-05  |  18KB  |  940 lines

  1. ;Programm: VersionPlus ist ein kleines Programm um die Version als FileComment zu setzen
  2. ;Autor   : Andre´ Trettin
  3. ;Codename: Banger
  4. ;Begin   : Dez-94
  5. ;$VER    : VersionPlus.Asm 1.357 05-Sep-95
  6.  
  7. ** INCLUDE Struktur Variablen
  8. * Fehler Codes: 21=kein Speicher
  9. *               22=konnte DOS.library nicht öffnen
  10. *               23=konnte File nicht öffnen
  11.  
  12.     incdir INCLUDE:
  13.     include lvo/dos_lib.i
  14.     include lvo/exec_lib.i
  15.     include dos/dos.i
  16.     include exec/exec.i
  17.  
  18.     STRUCTURE Internal,0
  19.     APTR    DOSBase
  20.     APTR    TempArray
  21.     APTR    CSAArg
  22.     APTR    NDAArg
  23.     APTR    ONCArg
  24.     APTR    ALLArg
  25.     APTR    QUIETArg
  26.     APTR    RDArgs
  27.     APTR    FileListe
  28.     APTR    letztesFile
  29.     APTR    MyBasisLock
  30.     APTR    JetzigeLock
  31.     STRUCT  JetzigerFIB,[fib_SIZEOF]
  32.     STRUCT  FIBs,[fib_SIZEOF*21]
  33.     STRUCT  MyLocks,[4*21]
  34.     STRUCT  BufferName,[512]
  35.     WORD    DirAnzahl
  36. *; Unterprog File bearbeitung ****
  37.     APTR    FileMem
  38.     APTR    FileHandle
  39.     WORD    Output2Leer
  40.     STRUCT  BufferComment,[88]
  41.     APTR    OutputHandle
  42.     WORD    Suche1Var
  43.     BYTE    Suche2Var
  44.     BYTE    Suche3Var
  45.     BYTE    Suche4Var
  46.     BYTE    Suche5Var
  47.     BYTE    Suche6Var
  48.     BYTE    SucheJModem
  49.     LABEL   Int_SIZEOF
  50. ;;
  51. ** Int-Speicher reservieren + dos.lib öffene
  52.     moveq   #0,d7
  53.     move.l  4.w,a6
  54.     move.l  #Int_SIZEOF,d0
  55.     move.l  #MEMF_PUBLIC!MEMF_CLEAR,d1
  56.     jsr     _LVOAllocMem(a6)
  57.     move.l  d0,a5
  58.     bne.s   LibraryOeffnen
  59.     moveq   #21,d7           ;21 = kein Speicher
  60.     bra.w   Ende
  61. LibraryOeffnen
  62.     lea     dosname(pc),a1
  63.     moveq   #37,d0
  64.     jsr     _LVOOpenLibrary(a6)
  65.     move.l  d0,DOSBase(a5)
  66.     bne.s   LibOK
  67.     moveq   #22,d7              ;22 = konnte dos.library nicht öffnen
  68.     bra.w   IntMemFree
  69. ;;
  70. ** Parse Parameter with readarg
  71. LibOK
  72.     move.l  DOSBase(a5),a6
  73.     lea     Comtemplate(pc),a1
  74.     move.l  a1,d1
  75.     lea     TempArray(a5),a1
  76.     move.l  a1,d2
  77.     moveq   #0,d3
  78.     jsr     _LVOReadArgs(a6)
  79.     move.l  d0,RDArgs(a5)
  80.     bne.s   ParaOK
  81.     bsr.w   DOS_Fehler
  82.     bra.w   SchliesseLib
  83. ;;
  84. ** Filesearch routine
  85. ParaOK
  86.     move.w  #'  ',Output2Leer(a5)
  87.     jsr     _LVOOutput(a6)
  88.     move.l  d0,OutputHandle(a5)
  89.     tst.l   QUIETArg(a5)
  90.     bne.s   keinWillkommen
  91.     move.l  d0,d1
  92.     lea     Willkommen(pc),a0
  93.     move.l  a0,d2
  94.     moveq   #WillkommenEnde-Willkommen,d3
  95.     jsr     _LVOWrite(a6)
  96. keinWillkommen
  97. ;    lea     TempPC(pc),a0
  98. ;    move.l  a0,TempArray(a5)
  99.     moveq   #0,d6
  100.     move.l  TempArray(a5),a4
  101. naechstesTArray
  102.     move.l  (a4)+,d1
  103.     beq.w   keinFilemehr
  104.     move.l  #ACCESS_READ,d2
  105.     jsr     _LVOLock(a6)
  106.     move.l  d0,MyBasisLock(a5)
  107.     bne.s   LockisOK
  108.     bsr.w   DOS_Fehler
  109.     bra.w   keinFilemehr
  110. LockisOK
  111.     move.l  MyBasisLock(a5),JetzigeLock(a5)
  112. naechstesDir
  113.     move.l  JetzigeLock(a5),d1
  114.     lea     JetzigerFIB(a5),a3
  115.     move.l  a3,d2
  116.     jsr     _LVOExamine(a6)
  117.     tst.l   d0
  118.     bne.s   ExamineIsOK
  119.     bsr.w   DOS_Fehler
  120.     bra.w   UnlockMyBasis
  121. ExamineIsOK
  122.     move.l  fib_DirEntryType(a3),d0
  123.     tst.l   d0
  124.     bmi.w   einFile
  125. naechstesFile
  126.     move.l  JetzigeLock(a5),d1
  127.     lea     JetzigerFIB(a5),a3
  128.     move.l  a3,d2
  129.     jsr     _LVOExNext(a6)
  130.     tst.l   d0
  131.     bne.s   FileOderDir
  132.     jsr     _LVOIoErr(a6)
  133.     cmp.w   #ERROR_NO_MORE_ENTRIES,d0
  134.     beq.s   JetzigeUnlock
  135.     bsr.w   DOS_Fehler
  136. JetzigeUnlock
  137.     sub.w   #1,DirAnzahl(a5)
  138.     move.w  DirAnzahl(a5),d5
  139.     tst.w   d5
  140.     bmi.w   UnlockMyBasis
  141.     move.l  JetzigeLock(a5),d1
  142.     jsr     _LVOUnLock(a6)
  143.     move.w  d5,d1
  144.     asl.w   #2,d1
  145.     lea     MyLocks(a5),a0
  146.     lea     (a0,d1.w),a0
  147.     move.l  (a0),JetzigeLock(a5)
  148.     move.w  #fib_SIZEOF,d0
  149.     mulu    d0,d5
  150.     lea     FIBs(a5),a0
  151.     lea     (a0,d5.w),a0
  152.     subq    #1,d0
  153. restoreFIB
  154.     move.b  (a0)+,(a3)+
  155.     dbra    d0,restoreFIB
  156.     bra.s   naechstesFile
  157. FileOderDir
  158.     move.l  fib_DirEntryType(a3),d0
  159.     tst.l   d0
  160.     bmi.s   einFileImDir
  161.     tst.l   ALLArg(a5)
  162.     beq.s   naechstesFile
  163.     move.w  DirAnzahl(a5),d5
  164.     move.w  d5,d1
  165.     add.w   #1,DirAnzahl(a5)
  166.     asl.w   #2,d1
  167.     lea     MyLocks(a5),a2
  168.     lea     (a2,d1.w),a2
  169.     move.l  JetzigeLock(a5),(a2)
  170.     move.l  JetzigeLock(a5),d1
  171.     lea     BufferName(a5),a2
  172.     move.l  a2,d2
  173.     move.l  #512,d3
  174.     jsr     _LVONameFromLock(a6)
  175.     move.l  a2,d1
  176.     lea     fib_FileName(a3),a0
  177.     move.l  a0,d2
  178.     move.l  #512,d3
  179.     jsr     _LVOAddPart(a6)
  180.     move.l  a2,d1
  181.     move.l  #ACCESS_READ,d2
  182.     jsr     _LVOLock(a6)
  183.     move.l  d0,JetzigeLock(a5)
  184.     move.w  #fib_SIZEOF,d0
  185.     mulu    d0,d5
  186.     lea     FIBs(a5),a0
  187.     lea     (a0,d5.w),a0
  188.     subq    #1,d0
  189. copyFIB
  190.     move.b  (a3)+,(a0)+
  191.     move.b  #0,-1(a3)
  192.     dbra    d0,copyFIB
  193.     bra.w   naechstesDir
  194. einFile
  195.     moveq   #-1,d6
  196. einFileImDir
  197.     move.l  JetzigeLock(a5),d1
  198.     lea     BufferName(a5),a0
  199.     move.l  a0,d2
  200.     move.l  #512,d3
  201.     jsr     _LVONameFromLock(a6)
  202.     move.l  d6,letztesFile(a5)
  203.     move.l  a4,FileListe(a5)
  204.     bsr.s   FileBearbeit
  205.     move.l  FileListe(a5),a4
  206.     move.l  letztesFile(a5),d6
  207.     tst.l   d6
  208.     beq.w   naechstesFile
  209.     moveq   #0,d6
  210. UnlockMyBasis
  211.     move.l  MyBasisLock(a5),d1
  212.     jsr     _LVOUnLock(a6)
  213.     bra.w   naechstesTArray
  214. ;;
  215. ** FreeArgs
  216. keinFilemehr
  217.    move.l  RDArgs(a5),d1
  218.    jsr     _LVOFreeArgs(a6)
  219. ;;
  220. ** dos.library schliessen + int speicher freigeben + ende
  221. SchliesseLib
  222.     move.l  4.w,a6
  223.     move.l  DOSBase(a5),a1
  224.     jsr     _LVOCloseLibrary(a6)
  225. IntMemFree
  226.     move.l  a5,a1
  227.     move.l  #Int_SIZEOF,d0
  228.     jsr     _LVOFreeMem(a6)
  229. Ende
  230.     move.l  d7,d0
  231.     rts
  232. ;;
  233. ** DOS-Fehler + Ausgabe routine
  234. DOS_Fehler
  235.     jsr     _LVOIoErr(a6)
  236.     move.l  d0,d1
  237.     moveq   #0,d2
  238.     jsr     _LVOPrintFault(a6)
  239.     rts
  240. ;;
  241. ** FileBearbeit
  242. * a3 : FIB-struct
  243. * a5 : Internal-struct
  244. * a6 : DOSBase
  245. FileBearbeit
  246.     tst.l   d6
  247.     bmi.s   einFileName
  248.     lea     BufferName(a5),a0
  249.     move.l  a0,d1
  250.     lea     fib_FileName(a3),a0
  251.     move.l  a0,d2
  252.     move.l  #512,d3
  253.     jsr     _LVOAddPart(a6)
  254. einFileName
  255.     move.l  4.w,a6
  256.     move.l  fib_Size(a3),d0
  257.     move.l  #MEMF_PUBLIC!MEMF_CLEAR,d1
  258.     jsr     _LVOAllocMem(a6)
  259.     move.l  d0,FileMem(a5)
  260.     bne.s   oeffnen
  261.     moveq   #21,d7
  262.     bra.s   FileSucheEnde
  263. oeffnen
  264.     move.l  DOSBase(a5),a6
  265.     lea     BufferName(a5),a0
  266.     move.l  a0,d1
  267.     move.l  #MODE_OLDFILE,d2
  268.     jsr     _LVOOpen(a6)
  269.     move.l  d0,FileHandle(a5)
  270.     bne.s   lesen
  271.     bra.s   DOS_Fehler
  272.     bra.s   FileSpeicherFrei
  273. lesen
  274.     move.l  FileHandle(a5),d1
  275.     move.l  FileMem(a5),d2
  276.     move.l  fib_Size(a3),d3
  277.     jsr     _LVORead(a6)
  278.     bsr.s   VersionFinden
  279.     moveq   #0,d7
  280.     bsr.w   CommentAusgabe
  281.     move.l  FileHandle(a5),d1
  282.     jsr     _LVOClose(a6)
  283. FileSpeicherFrei
  284.     move.l  4.w,a6
  285.     move.l  fib_Size(a3),d0
  286.     move.l  FileMem(a5),a1
  287.     jsr     _LVOFreeMem(a6)
  288. FileSucheEnde
  289.     move.l  DOSBase(a5),a6
  290.     rts
  291. ;;
  292. ** VersionFinden
  293. VersionFinden
  294. ** Suche $VER:
  295.     move.b  #0,Suche3Var(a5)
  296.     move.b  #0,Suche4Var(a5)
  297.     move.b  #0,Suche5Var(a5)
  298.     move.b  #0,Suche6Var(a5)
  299.     move.b  #0,SucheJModem(a5)
  300.     move.l  fib_Size(a3),d0
  301.     subq    #2,d0
  302.     lea     BufferComment(a5),a2
  303.     move.l  #0,(a2)
  304.     move.l  FileMem(a5),a0
  305.     move.l  d0,d3
  306.     swap    d3
  307.     sub.w   d3,d0
  308. Suche1Loop
  309.     cmp.b   #'$',(a0)+
  310.     beq.s   Suche1Erfolg
  311.     dbra    d0,Suche1Loop
  312.     dbra    d3,Suche1Loop
  313.     bra.w   Suche3
  314. ;;
  315. ** Suche 1
  316. Suche1Erfolg
  317.     cmp.w   #'VE',(a0)
  318.     bne.s   Suche1Loop
  319.     cmp.b   #'R',2(a0)
  320.     bne.s   Suche1Loop
  321.     lea     4(a0),a0
  322.     moveq   #-1,d1
  323. Suche1Version
  324.     moveq   #0,d4
  325. Zahlen1Testen
  326.     addq    #1,d4
  327.     cmp.w   #128,d4
  328.     beq.w   naechsteSuche
  329.     subq    #1,d0
  330.     tst.w   d3
  331.     bne.s   Ver1testen
  332.     cmp.w   #2,d0
  333.     beq.w   naechsteSuche
  334. Ver1testen
  335.     cmp.b   #$39,(a0)+       ;Zahlencode 30-39
  336.     bhi.s   Zahlen1Testen
  337.     cmp.b   #$2F,-1(a0)
  338.     bls.s   Zahlen1Testen
  339.     tst.b   d1
  340.     beq.s   Suche1aErfolg
  341.     bsr.w   VersionName
  342.     tst.b   d1
  343.     beq.s   Zahlen1Testen
  344. Suche1aErfolg
  345.     move.b  -2(a0),d2
  346.     bclr    #5,d2
  347.     cmp.b   #'V',d2
  348.     beq.s   VorVersion1Check
  349.     cmp.b   #$20,-2(a0)
  350.     beq.s   VorVersion1Check
  351.     cmp.b   #'(',-2(a0)
  352.     beq.w   VerNr1aEnde
  353.     bra.s   Zahlen1Testen
  354. VorVersion1Check
  355.     cmp.b   #$20,(a0)
  356.     beq.s   VorVersion2Check
  357.     cmp.b   #$2e,(a0)
  358.     beq.s   VorVersion2Check
  359.     tst.b   Suche6Var(a5)
  360.     beq.s   Suche1VorVersiontest
  361.     cmp.b   #' ',1(a0)
  362.     beq.s   Suche1VorVersiontest
  363.     cmp.b   #'.',1(a0)
  364.     beq.s   Suche1VorVersiontest
  365.     cmp.b   #10,1(a0)
  366.     beq.s   Suche1VorVersiontest
  367.     cmp.b   #13,1(a0)
  368.     beq.s   Suche1VorVersiontest
  369.     cmp.b   #$39,1(a0)
  370.     bhi.w   Zahlen1Testen
  371.     cmp.b   #$2F,1(a0)
  372.     bls.w   Zahlen1Testen
  373. Suche1VorVersiontest
  374.     cmp.b   #$39,(a0)
  375.     bhi.w   Zahlen1Testen
  376.     cmp.b   #$2F,(a0)
  377.     bls.w   Zahlen1Testen
  378. VorVersion2Check
  379.     move.w  #'V ',(a2)+
  380.     move.b  -1(a0),(a2)+
  381. VerNr1Loop
  382.     move.b  (a0)+,(a2)+
  383.     subq    #1,d0
  384.     cmp.b   #' ',-1(a2)
  385.     beq.s   VerNr1Ende
  386.     cmp.b   #'(',-1(a2)
  387.     beq.s   VerNr1Leer
  388.     cmp.b   #',',-1(a2)
  389.     beq.s   VerNr1Leer
  390.     cmp.b   #13,-1(a2)
  391.     beq.s   VerNr1Leer
  392.     cmp.b   #10,-1(a2)
  393.     beq.s   VerNr1Leer
  394.     cmp.b   #0,-1(a2)
  395.     bne.s   VerNr1Loop
  396. VerNr1Leer  
  397.     move.b  #' ',-1(a2)
  398. VerNr1Ende  
  399.     tst.l   NDAArg(a5)
  400.     bne.w   kein1Datum
  401.     move.l  a0,a1
  402.     move.w  d0,d5
  403.     moveq   #0,d4
  404. Suche1Datum
  405.     addq    #1,d4
  406.     cmp.w   #128,d4
  407.     beq.w   Suche2Datum
  408.     subq    #1,d0
  409.     tst.w   d3
  410.     bne.s   Ver2testen
  411.     tst.w   d0
  412.     beq.w   Suche2Datum
  413. Ver2testen
  414.     cmp.b   #'(',(a0)+
  415.     bne.s   Suche1Datum
  416.     cmp.b   #$39,(a0)
  417.     bhi.s   Datum2format
  418.     cmp.b   #$2F,(a0)
  419.     bls.s   Suche1Datum
  420.     cmp.b   #$39,1(a0)
  421.     bhi.s   Datum1format
  422.     cmp.b   #$2F,1(a0)
  423.     bls.s   Datum1format
  424. Datum1Erfolg    
  425.     move.b  -1(a0),(a2)+
  426. Datum1Loop
  427.     subq    #1,d0
  428.     beq.w   Datum1Gefunden
  429.     move.b  (a0)+,(a2)+
  430.     cmp.b   #')',-1(a2)
  431.     bne.s   Datum1Loop
  432.     bra.w   Datum1Gefunden
  433. Datum2format
  434.     move.l  a0,d2
  435.     move.b  (a0)+,d7
  436.     bclr    #5,d7
  437.     cmp.b   #'Z',d7
  438.     bhi.s   Suche1Datum
  439.     cmp.b   #$40,d7
  440.     bls.s   Suche1Datum
  441.     bsr.s   Buchstabe
  442.     tst.b   d1
  443.     beq.s   Suche1Datum
  444.     bsr.s   Buchstabe
  445.     tst.b   d1
  446.     beq.s   Suche1Datum
  447.     move.l  d2,a0
  448.     bra.s   Datum1Erfolg
  449. Buchstabe
  450.     cmp.b   #$7a,(a0)+
  451.     bhi.s   Datum2keinB
  452.     cmp.b   #$40,-1(a0)
  453.     bls.s   Datum2keinB
  454.     moveq   #1,d1
  455.     rts
  456. Datum2keinB
  457.     moveq   #0,d1
  458.     rts
  459. Datum1format
  460.     cmp.b   #'.',1(a0)
  461.     beq.s   Datum1Erfolg
  462.     cmp.b   #'-',1(a0)
  463.     beq.s   Datum1Erfolg
  464.     cmp.b   #'/',1(a0)
  465.     beq.s   Datum1Erfolg
  466.     cmp.b   #' ',1(a0)
  467.     beq.s   Datum1Erfolg
  468.     cmp.b   #':',1(a0)
  469.     beq.s   Datum1Erfolg
  470.     bra.w   Suche1Datum 
  471. Datumformat
  472.     cmp.b   #'.',(a0)
  473.     beq.s   DatePunkt
  474.     cmp.b   #'-',(a0)
  475.     beq.s   DateStrich
  476.     cmp.b   #'/',(a0)
  477.     beq.s   DateSlash
  478.     cmp.b   #' ',(a0)
  479.     beq.s   DateLeer
  480.     cmp.b   #':',(a0)
  481.     beq.s   DateDoppelPunkt
  482.     rts
  483. DateDoppelPunkt
  484.     move.b  #':',d1
  485.     rts
  486. DatePunkt
  487.     move.b  #'.',d1
  488.     rts
  489. DateStrich
  490.     move.b  #'-',d1
  491.     rts     
  492. DateSlash
  493.     move.b  #'/',d1
  494.     rts     
  495. DateLeer
  496.     move.b  #' ',d1
  497.     rts
  498. Suche2Datum
  499.     move.l  a1,a0
  500.     move.w  d5,d0
  501.     moveq   #0,d4
  502. Suche2Loop
  503.     addq    #1,d4
  504.     cmp.w   #128,d4
  505.     beq.s   kein1Datum
  506.     subq    #1,d0
  507.     tst.w   d3
  508.     bne.s   Ver3testen
  509.     tst.w   d0
  510.     beq.s   kein1Datum
  511. Ver3testen
  512.     cmp.b   #$39,(a0)+
  513.     bhi.s   Suche2Loop
  514.     cmp.b   #$2F,-1(a0)
  515.     bls.s   Suche2Loop
  516.     move.l  a0,a1
  517.     moveq   #0,d1
  518.     bsr.s   Datumformat
  519.     addq    #1,a0
  520.     bsr.s   Datumformat
  521.     tst.b   d1
  522.     beq.s   Suche2Loop
  523.     addq    #1,a0
  524.     moveq   #9,d2
  525. Suche2aLoop
  526.     cmp.b   (a0)+,d1
  527.     beq.s   Suche2Monat
  528.     dbra    d2,Suche2aLoop
  529. SucheWieder 
  530.     move.l  a1,a0
  531.     bra.s   Suche2Loop
  532. Suche2Monat 
  533.     cmp.b   #$39,(a0)
  534.     bhi.s   SucheWieder
  535.     cmp.b   #$2F,(a0)
  536.     bls.s   SucheWieder
  537.     cmp.b   #$39,2(a0)
  538.     bhi.s   Jahrende
  539.     cmp.b   #$2F,2(a0)
  540.     bls.s   Jahrende
  541.     addq    #2,a0
  542. Jahrende
  543.     addq    #2,a0
  544.     sub.l   a1,a0
  545.     move.l  a0,d2
  546.     subq    #1,d2
  547.     move.b  -1(a1),(a2)+
  548. Suche2bLoop
  549.     subq    #1,d0
  550.     beq.s   Datum1Gefunden
  551.     move.b  (a1)+,(a2)+
  552.     dbra    d2,Suche2bLoop
  553. Datum1Gefunden                  
  554.     move.b  #' ',(a2)+
  555. kein1Datum
  556.     rts
  557. naechsteSuche
  558.     tst.b   Suche3Var(a5)
  559.     beq.w   Suche3
  560.     bra.w   Suche3Fortsetzen
  561. VerNr1aEnde
  562.     tst.l   NDAArg(a5)
  563.     bne.s   kein1Datum
  564.     lea     -2(a0),a0
  565.     move.w  #'V ',(a2)+
  566.     bra.w   VerNr1Ende
  567. ;;
  568. ** VersionName
  569. VersionName
  570.     lea     fib_FileName(a3),a1
  571.     bsr.s   ZahlCheck
  572.     tst.b   d1
  573.     beq.s   VersionNaKZEnd
  574.     move.l  a0,d2
  575.     cmp.b   -1(a0),d1
  576.     bne.s   VersionNameEnde
  577. VerZahlLoop
  578.     bsr.s   ZahlCheck
  579.     tst.b   d1
  580.     beq.s   VersionNaVorEnde
  581.     exg     a0,a1
  582.     bsr.s   ZahlCheck
  583.     tst.b   d1
  584.     beq.s   VersionNaVorEnde
  585.     exg     a0,a1
  586.     cmp.b   -1(a1),d1
  587.     beq.s   VerZahlLoop
  588.     move.l  d2,a0
  589. VersionNaKZEnd
  590.     moveq   #-1,d1
  591.     rts
  592. VersionNaVorEnde
  593.     moveq   #0,d1
  594. VersionNameEnde
  595.     rts
  596. ;;
  597. ** ZahlCheck
  598. ZahlCheck
  599.     move.b  (a1)+,d1
  600.     cmp.b   #0,d1
  601.     beq.s   ZahlCheckEnde
  602.     cmp.b   #$39,d1
  603.     bhi.s   ZahlCheck
  604.     cmp.b   #$2F,d1
  605.     bls.s   ZahlCheck
  606. ZahlCheckEnde
  607.     rts
  608. ;;
  609. ** InitSuche
  610. InitSuche
  611.     move.l  fib_Size(a3),d0
  612.     subq    #2,d0
  613.     move.l  d0,d3
  614.     swap    d3
  615.     sub.w   d3,d0
  616.     lea     fib_FileName(a3),a1
  617.     move.b  (a1),d1
  618.     bclr    #5,d1
  619.     move.b  d1,Suche2Var(a5)
  620.     move.l  a1,a0
  621. FileName3Loop
  622.     cmp.b   #0,(a1)+
  623.     beq.s   FileName3Ende
  624.     cmp.b   -1(a1),d2
  625.     bne.s   FileName3Loop
  626. FileName3Ende
  627.     sub.l   a0,a1
  628.     move.w  a1,d2
  629.     subq    #3,d2
  630.     move.w  d2,Suche1Var(a5)
  631.     move.l  FileMem(a5),a0
  632.     rts
  633. ;;
  634. ** Suche3
  635. Suche3
  636.     move.b  #1,Suche3Var(a5)
  637.     moveq   #0,d2
  638.     bsr.s   InitSuche
  639. Suche3Fortsetzen
  640.     move.b  Suche2Var(a5),d1
  641. Suche3Loop
  642.     move.b  (a0)+,d2
  643.     bclr    #5,d2
  644.     cmp.b   d1,d2
  645.     beq.s   Suche3Erfolg
  646.     dbra    d0,Suche3Loop
  647.     dbra    d3,Suche3Loop
  648.     bra.w   SuchMisErfolg
  649. Suche3Erfolg
  650.     lea     fib_FileName(a3),a1
  651.     lea     1(a1),a1
  652.     move.l  a0,d4
  653.     move.w  d0,d5
  654.     move.w  Suche1Var(a5),d2
  655. Suche3aLoop
  656.     subq    #1,d0
  657.     beq.w   SuchMisErfolg
  658.     move.b  (a0)+,d7
  659.     bclr    #5,d7
  660.     move.b  (a1)+,d6
  661.     bclr    #5,d6
  662.     cmp.b   d6,d7
  663.     bne.s   nicht2Erfolg
  664.     dbra    d2,Suche3aLoop
  665.     moveq   #0,d1
  666.     tst.b   Suche6Var(a5)
  667.     beq.s   Suche3normal
  668.     move.l  fib_Size(a3),d4
  669.     move.w  d3,d1
  670.     swap    d1
  671.     move.w  d0,d1
  672.     addq    #3,d1
  673.     sub.l   d1,d4
  674.     cmp.w   #127,d4
  675.     bhi.s   halbesB
  676.     lea     (a0,d4.w),a0
  677.     bra.w   Zahlen1Testen
  678. halbesB
  679.     lea     -128(a0),a0
  680. Suche3normal
  681.     bra.w   Suche1Version
  682. nicht2Erfolg
  683.     move.l  d4,a0
  684.     move.w  d5,d0
  685.     bra.s   Suche3Loop
  686. ;;
  687. ** Suche4
  688. Suche4
  689.     move.b  #1,Suche4Var(a5)
  690.     moveq   #'.',d2
  691.     bsr.w   InitSuche
  692.     bra.w   Suche3Fortsetzen
  693. ;;
  694. ** Suche5
  695. * sucht nach "VERSION"
  696. Suche5
  697.     move.b  #1,Suche5Var(a5)
  698.     lea     VersionStr(pc),a4
  699.     move.b  #'V',d7
  700.     moveq   #5,d6
  701. Suche5extern
  702.     move.l  fib_Size(a3),d0
  703.     subq    #2,d0
  704.     move.l  d0,d3
  705.     swap    d3
  706.     sub.w   d3,d0
  707.     move.l  FileMem(a5),a0
  708. Suche5Loop
  709.     move.b  (a0)+,d1
  710.     bclr    #5,d1
  711.     cmp.b   d7,d1
  712.     beq.s   Suche5Erfolg
  713.     dbra    d0,Suche5Loop
  714.     dbra    d3,Suche5Loop
  715.     bra.s   SuchMisErfolg
  716. Suche5Erfolg
  717.     move.l  a4,a1
  718.     move.l  a0,d4
  719.     move.w  d6,d2
  720. Suche5aLoop
  721.     move.b  (a0)+,d1
  722.     bclr    #5,d1
  723.     cmp.b   (a1)+,d1
  724.     bne.s   Suche5Miss
  725.     dbra    d2,Suche5aLoop
  726.     moveq   #128-16,d4
  727.     bra.w   Zahlen1Testen
  728. Suche5Miss
  729.     move.l  d4,a0
  730.     bra.s   Suche5Loop
  731. ;;
  732. ** Suche6
  733. Suche6
  734.     move.b  #1,Suche6Var(a5)
  735.     bra.w   Suche3
  736. ;;
  737. ** FileNameJModem
  738. FileNameJModem
  739.     move.b  #1,SucheJModem(a5)
  740.     lea     JModemStr(pc),a4
  741.     move.b  #'J',d7
  742.     moveq   #4,d6
  743.     lea     fib_FileName(a3),a1
  744. FileNameJMLoop
  745.     move.b  (a1)+,d1
  746.     bclr    #5,d1
  747.     cmp.b   d7,d1
  748.     beq.s   FileNameJMErfolg
  749.     cmp.b   #0,d1
  750.     bne.s   FileNameJMLoop
  751.     rts
  752. FileNameJMErfolg
  753.     move.l  a4,a0
  754.     move.l  a1,d4
  755.     moveq   #4,d2
  756. FileNameJM2Loop
  757.     move.b  (a1)+,d1
  758.     bclr    #5,d1
  759.     cmp.b   (a0)+,d1
  760.     bne.s   FileNameJMMiss
  761.     dbra    d2,FileNameJM2Loop
  762.     bra.w   Suche5extern
  763. FileNameJMMiss
  764.     move.l  d4,a0
  765.     bra.s   FileNameJMLoop
  766. ;;
  767. ** SuchMisErfolg
  768. SuchMisErfolg
  769.     tst.b   Suche4Var(a5)
  770.     beq.w   Suche4
  771.     tst.b   Suche5Var(a5)
  772.     beq.w   Suche5
  773.     tst.b   Suche6Var(a5)
  774.     beq.s   Suche6
  775.     tst.b   SucheJModem(a5)
  776.     beq.s   FileNameJModem
  777.     rts
  778. ;;
  779.  
  780. ;;
  781. ** Comment Bearbeitung + Schreiben + Ausgabe
  782. CommentAusgabe
  783.     tst.l   ONCArg(a5)
  784.     bne.w   keinCommSA
  785.     lea     fib_Comment(a3),a1
  786.     lea     NichtMoeglich(pc),a0
  787.     moveq   #2,d1
  788. nichtmLoop
  789.     move.l  (a1)+,d0
  790.     cmp.l   (a0)+,d0
  791.     bne.s   VersionErkennen
  792.     dbra    d1,nichtmLoop
  793.     bra.w   keinCommSA
  794. VersionErkennen
  795.     lea     BufferComment(a5),a1
  796.     move.l  a1,a0
  797.     sub.l   a2,a1
  798.     move.l  a1,d0
  799.     neg.l   d0
  800.     lea     fib_Comment(a3),a1
  801.     tst.b   (a1)
  802.     bne.s   einComment
  803.     cmp.l   a2,a0
  804.     beq.w   QuietTest
  805.     move.b  #0,-1(a2)
  806.     bra.w   VComent
  807. alteDate2Loop
  808.     cmp.b   #')',(a1)+
  809.     bne.s   alteDate2Loop
  810.     bra.s   keineVersComment        
  811. Leer2Stellen
  812.     lea 4(a1),a1
  813. Leer2Loop
  814.     cmp.b   #' ',(a1)+
  815.     bne.s   Leer2Loop
  816. Leer2aLoop
  817.     cmp.b   #' ',(a1)+
  818.     beq.s   keineVersComment
  819.     cmp.b   #0,-1(a1)
  820.     bne.s   Leer2aLoop
  821.     bra.s   keineVersComment
  822. einComment  
  823.     cmp.w   #'V ',(a1)
  824.     bne.s   keineVersComment
  825.     tst.l   (a0)
  826.     beq.s   keineVersComment
  827.     lea     2(a1),a1
  828.     lea     2(a0),a0
  829.     move.b  (a1)+,d1
  830.     cmp.b   (a0)+,d1
  831.     bne.s   keineVersComment
  832.     cmp.b   #'(',-1(a1)
  833.     beq.s   alteDate2Loop
  834. alteVerLoop
  835.     cmp.b   #' ',(a1)+
  836.     beq.s   DateComment
  837.     cmp.b   #0,-1(a1)
  838.     bne.s   alteVerLoop
  839. DateComment
  840.     tst.l   NDAArg(a5)
  841.     bne.s   keineVersComment
  842.     cmp.b   #'(',(a1)
  843.     beq.s   alteDate2Loop
  844.     cmp.b   #$39,(a1)
  845.     bhi.s   keineVersComment
  846.     cmp.b   #$2f,(a1)
  847.     bls.s   keineVersComment
  848.     cmp.b   #' ',1(a1)
  849.     beq.s   Leer2Stellen
  850.     cmp.b   #' ',2(a1)
  851.     beq.s   Leer2Stellen
  852. alteDateLoop    
  853.     cmp.b   #' ',(a1)+
  854.     beq.s   keineVersComment
  855.     cmp.b   #0,-1(a1)
  856.     bne.s   alteDateLoop
  857. keineVersComment
  858.     tst.b   (a1)
  859.     bne.s   ein2Comment
  860.     move.b  #0,-1(a2)
  861. ein2Comment
  862.     tst.l   CSAArg(a5)
  863.     beq.s   Comment1Loop
  864.     move.l  a1,a0
  865. WoIstDieNull
  866.     tst.b   (a0)+
  867.     bne.s   WoIstDieNull
  868.     sub.l   a1,a0
  869.     moveq   #79,d1
  870.     sub.w   a0,d1
  871.     addq    #1,d1
  872.     cmp.w   d1,d0
  873.     bls.s   Indexsetzen
  874.     move.l  d1,d0
  875. Indexsetzen
  876.     lea     BufferComment(a5),a2
  877.     lea     (a2,d0.w),a2
  878. Comment1Loop
  879.     move.b  (a1)+,(a2)+
  880.     addq    #1,d0
  881.     cmp.b   #79,d0
  882.     bne.s   Comment1Loop
  883. VComent 
  884.     lea     BufferName(a5),a0
  885.     move.l  a0,d1
  886.     lea     BufferComment(a5),a0
  887.     move.l  a0,d2
  888.     jsr     _LVOSetComment(a6)
  889.     tst.l   d0
  890.     beq.s   QuietTest
  891.     bsr.w   DOS_Fehler
  892. QuietTest
  893.     tst.l   QUIETArg(a5)
  894.     bne.s   LoescheBuffer
  895. keinCommSA
  896.     lea     fib_FileName(a3),a1
  897.     move.l  a1,a0
  898. WoIstDie2Null
  899.     tst.b   (a0)+
  900.     bne.s   WoIstDie2Null
  901.     sub.l   a1,a0
  902.     move.l  a0,d3
  903.     subq    #1,d3
  904.     move.l  a1,d2
  905.     move.l  OutputHandle(a5),d1
  906.     jsr     _LVOWrite(a6)
  907.     lea     Output2Leer(a5),a1
  908.     move.l  a1,a0
  909. WoIstDie3Null
  910.     tst.b   (a0)+
  911.     bne.s   WoIstDie3Null
  912.     move.b  #10,-1(a0)
  913.     sub.l   a1,a0
  914.     move.l  a0,d3
  915.     move.l  a1,d2
  916.     move.l  OutputHandle(a5),d1
  917.     jsr     _LVOWrite(a6)
  918. LoescheBuffer
  919.     lea     BufferComment(a5),a0
  920.     moveq   #21,d0
  921. Loesche1Loop
  922.     move.l  #0,(a0)+
  923.     dbra    d0,Loesche1Loop
  924.     rts
  925. ;;
  926. ** Byte Daten
  927. JModemStr   dc.b 'MODEM'
  928. VersionStr  dc.b 'ERSION'
  929. NichtMoeglich dc.b 'nicht möglic'
  930. Willkommen  dc.b 10,10,'$VER: BangerVersion 1.357 (05-Sep-95)',10
  931.             dc.b 'Willkommen zu BangerVersion',10
  932.             dc.b 'Copyright by Andre´ Trettin',10,10
  933. WillkommenEnde
  934. Comtemplate dc.b 'FILES/A/M,CSA=COMMENTSAVE/S,NDA=NODATUM/S,ONC=ONLYCON/S,ALL/S,QUIET/S',0
  935. dosname     DOSNAME
  936. ;        even
  937. ;TempPC  dc.l File0,0
  938. ;File0   dc.b 'RAM:Ver',0
  939. ;;
  940.